﻿@model IEnumerable<CREAPA.Dominio.Funcionario>

@{
    ViewBag.Title = "Funcionario";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Lista de Funcionarios Ativos</h2>

<style type="text/css">
.table{
    border : 1px solid #809FFF;
    background-color: white;
    border-collapse: collapse; 
    border: 1px solid black; 
    width: 50%;
    /*border: 0px;*/
}

.header{
    background-color: #111839;
    color: white;
}

.header a{
    color: white;
    text-decoration: none;
}

.footer{
    background-color:#111839;
    color: white;
}

.alternate{
    background-color: #b7c3f6;
}

</style>

<br />

@{
    WebGrid grid = new WebGrid(source: Model, columnNames: new string[] { "Login", "IdInsp", "IdCargo", "Setor", "Pessoa.Email", "Pessoa.Nome"}, canPage: true, rowsPerPage: 200);
}

@grid.GetHtml( tableStyle: "table",
        alternatingRowStyle: "alternate",
        headerStyle: "header",
        footerStyle: "footer",
        mode: WebGridPagerModes.FirstLast | WebGridPagerModes.NextPrevious,
        firstText: "Primeiro",
        previousText: "Anterior",
        nextText: "Próximo",
        lastText: "Último",columns: grid.Columns(        
              grid.Column("Pessoa.Nome", header:"Nome", format: @<text><div style='width: 23em'>@item.Pessoa.Nome</div></text>),
              grid.Column("Login", header:"Usuario", format: @<text>@item.Login</text>),
              grid.Column("IdInsp", header:"Inspetoria", format: @<text>@item.IdInsp</text>),        
              grid.Column("Setor", header:"Setor", format: @<text><div style='width: 13em'>@item.Setor</div></text>),              
              grid.Column("IdCargo", header:"Cargo", format: @<text>@item.IdCargo</text>),
              grid.Column("Pessoa.Email", header:"Email", format: @<text>@item.Pessoa.Email</text>))
)